]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
MessageTray: destroy notifications manually when the source is destroyed
authorGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 25 Oct 2012 16:30:27 +0000 (18:30 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 6 Aug 2013 12:45:41 +0000 (14:45 +0200)
Using a signal handlers causes us to depend on connection order, but
we need the message tray code to run last, so it can notice that
notifications are destroyed when hiding the boxpointer and skip
the broken animation.

https://bugzilla.gnome.org/show_bug.cgi?id=686855

js/ui/messageTray.js

index 6b297b7274f7d678863bd908ae5e4dcdf06297e7..bf333ec19851d8050929c2f7bc9c3158a6038ce4 100644 (file)
@@ -404,11 +404,6 @@ const Notification = new Lang.Class({
         this._soundFile = null;
         this._soundPlayed = false;
 
-        source.connect('destroy', Lang.bind(this,
-            function (source, reason) {
-                this.destroy(reason);
-            }));
-
         this.actor = new St.Button({ accessible_role: Atk.Role.NOTIFICATION });
         this.actor.add_style_class_name('notification-unexpanded');
         this.actor._delegate = this;
@@ -1337,6 +1332,13 @@ const Source = new Lang.Class({
 
     destroy: function(reason) {
         this.policy.destroy();
+
+        let notifications = this.notifications;
+        this.notifications = [];
+
+        for (let i = 0; i < notifications.length; i++)
+            notifications[i].destroy(reason);
+
         this.emit('destroy', reason);
     },